package com.gitee.wsl.compose.coroutines.event

import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ProvidableCompositionLocal
import androidx.compose.runtime.staticCompositionLocalOf
import com.gitee.wsl.coroutines.event.Events


val LocalEvents: ProvidableCompositionLocal<Events?> = staticCompositionLocalOf { null }


@Suppress("ComposableNaming")
@Composable
fun installEvents(events: Events = Events(), child: @Composable () -> Unit) {
    CompositionLocalProvider(LocalEvents provides events, content = child)
}

